<script setup>
// 联系方式数据
const contactMethods = [
  {
    title: '邮箱',
    content: '1430844766@qq.com',
  },
  {
    title: '微信',
    content: 'Wei_xin_wjy',
  }
]
</script>

<template>
  <div class="contact-container">
    <main class="contact-content">
      <!-- 页面标题区域 -->
      <div class="header-section">
        <h1 class="page-title">
          <span
            class="title-word"
            v-for="(word, index) in '联系我'.split('')"
            :key="index"
          >
            {{ word }}
          </span>
        </h1>
        <p class="subtitle">有任何问题或合作意向？请随时与我联系</p>
      </div>

      <!-- 联系方式卡片 -->
      <div class="contact-methods">
        <div
          v-for="(method, index) in contactMethods"
          :key="index"
          class="contact-method"
        >
          <div class="contact-item">
            <el-icon class="contact-icon">
              <i-ep-message v-if="method.title === '邮箱'" />
              <i-ep-chat-dot-round v-else-if="method.title === '微信'" />
            </el-icon>
            <div class="contact-info">
              <h3 class="contact-title">{{ method.title }}</h3>
              <p class="contact-value ">{{ method.content }}</p>
            </div>
          </div>
        </div>
      </div>

      <!-- 页脚装饰 -->
      <div class="footer-decoration">
        <div class="decoration-line"></div>
        <div class="decoration-dot"></div>
        <div class="decoration-line"></div>
      </div>
    </main>
  </div>
</template>

<style scoped>
/* 全局样式变量 */

.contact-container {
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-top: 80px;
  /* 为固定导航栏留出空间 */
  padding-bottom: 3rem;
  background-image: radial-gradient(circle at 25% 25%,
      rgba(64, 158, 255, 0.05) 0%,
      transparent 50%),
    radial-gradient(circle at 75% 75%,
      rgba(103, 194, 58, 0.05) 0%,
      transparent 50%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-content {
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

/* 页面标题样式 */
.header-section {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.page-title {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.title-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

/* 为每个文字添加不同的动画延迟 */
.title-word:nth-child(1) {
  animation-delay: 0.1s;
}

.title-word:nth-child(2) {
  animation-delay: 0.2s;
}

.title-word:nth-child(3) {
  animation-delay: 0.3s;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.5s forwards;
}

/* 联系方式样式 */
.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.7s forwards;
}

.contact-method {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.contact-method:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.contact-method::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--primary-color);
  transition: all 0.3s ease;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  height: 100%;
}

.contact-icon {
  width: 48px;
  height: 48px;
  background-color: #f0f5ff;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.contact-info {
  text-align: left;
}

.contact-title {
  font-size: 1.1rem;
  font-weight: 600;
  user-select: none;
  margin: 0 0 0.3rem 0;
  color: var(--text-color);
}

.contact-value {
  font-size: 0.95rem;
  user-select: text;
  cursor: text;
  color: var(--text-secondary);
}

/* 页脚装饰 */
.footer-decoration {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3rem;
  opacity: 0;
  animation: fadeIn 1s ease 1s forwards;
}

.decoration-line {
  height: 1px;
  width: 40px;
  background-color: var(--border-color);
}

.decoration-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary-color);
  margin: 0 8px;
}

/* 动画定义 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .contact-content {
    padding: 1rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .contact-methods {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .contact-content {
    padding: 0.8rem;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .contact-method {
    padding: 1.2rem;
  }
}
</style>